package com.pcb.common;

/**
 * create by yongli on 2021-09-23 15:34
 */

public class CommentResult<T> {
    private Boolean satus;
    private T data;
    private String msg;

    private CommentResult() {
    }

    private CommentResult(Boolean satus, T data, String msg) {
        this.satus = satus;
        this.data = data;
        this.msg = msg;
    }

    // 静态方法
    public static <T> CommentResult<T> success(T data) {
        return new CommentResult<T>(true, data, "success");
    }

    public static CommentResult fail(String message) {
        return new CommentResult<Object>(true, null, message);
    }

    public Boolean getSatus() {
        return satus;
    }

    public void setSatus(Boolean satus) {
        this.satus = satus;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


}
